Package-level declarations

Custom or specialized UI components.

Types

Link copied to clipboard
class JDateTimeField(default: LocalDateTime = LocalDateTime.now()) : JFormattedTextField

A JFormattedTextField for LocalDateTimes, supporting virtually any date-time format as its input.

Link copied to clipboard
class JDoubleSpinner(value: Double = 0.0, minValue: Double? = null, maxValue: Double? = null, stepSize: Double = 0.1) : JNumberSpinner<Double>

A JNumberSpinner for doubles.

Link copied to clipboard
class JIntSpinner(value: Int = 0, minValue: Int = Int.MIN_VALUE, maxValue: Int = Int.MAX_VALUE, stepSize: Int = 1) : JNumberSpinner<Int>

A JNumberSpinner for integers.

Link copied to clipboard
class JLongSpinner(value: Long = 0, minValue: Long = Long.MIN_VALUE, maxValue: Long = Long.MAX_VALUE, stepSize: Long = 1) : JNumberSpinner<Long>

A JNumberSpinner for longs.

Link copied to clipboard
abstract class JNumberSpinner<T : Number, Comparable<T>>(value: T, minValue: T?, maxValue: T?, stepSize: T) : JSpinner

An abstract JSpinner for numbers that contains common logic for its subclasses.

Link copied to clipboard
class LiteralPredicate(output: Boolean) : ComponentPredicate

A predicate that always returns output.

Link copied to clipboard
open class MaxLengthDocumentFilter(maxLength: Int) : DocumentFilter

A document filter that ensures the document always contains at most maxLength characters.

Link copied to clipboard
class MinMaxLengthDocumentFilter(minLength: Int, maxLength: Int) : MaxLengthDocumentFilter

Similar to MaxLengthDocumentFilter, but the length cannot go below minLength either.

Link copied to clipboard
class PreviewPanel(getScheme: () -> Scheme) : Disposable

A panel that shows a preview of the values generated by a scheme.

Link copied to clipboard
class SimpleDocumentListener(listener: (DocumentEvent) -> Unit) : DocumentListener

A DocumentListener that invokes listener on each event.

Link copied to clipboard
class SimpleJBDocumentListener(listener: (DocumentEvent) -> Unit) : DocumentListener

A JBDocumentListener that invokes listener on each event.

Link copied to clipboard
class SimpleTreeModelListener(listener: (TreeModelEvent) -> Unit) : TreeModelListener

A TreeModelListener that invokes listener on each event.

Link copied to clipboard

Holds constants for UI elements.

Functions

Link copied to clipboard
fun addChangeListenerTo(vararg components: Any, listener: () -> Unit)

Adds listener to each of components.

Link copied to clipboard
fun Cell<ComboBox<String>>.bindCurrentText(property: KMutableProperty0<String>): Cell<ComboBox<String>>

Binds the current possibly-non-committed value of the ComboBox in this Cell to property.

Link copied to clipboard
fun Cell<JDateTimeField>.bindDateTimeLongValue(property: KMutableProperty0<Long>): Cell<JDateTimeField>

Binds the Long representation of the value of the JDateTimeField in this Cell to property.

Link copied to clipboard
fun Cell<JIntSpinner>.bindIntValue(property: KMutableProperty0<Int>): Cell<JIntSpinner>

Binds the value of the JIntSpinner in this Cell to property.

Link copied to clipboard
fun Cell<JLongSpinner>.bindLongValue(property: KMutableProperty0<Long>): Cell<JLongSpinner>

Binds the value of the JLongSpinner in this Cell to property.

Link copied to clipboard
fun bindSpinners(min: JSpinner, max: JSpinner, maxRange: Double? = null)

Binds two spinners that form a range of valid values together.

Link copied to clipboard
fun Panel.decoratedRowRange(title: String? = null, indent: Boolean, init: Panel.() -> Unit): RowsRange

Creates and returns a range of rows from init, headed by an underlined title if and only if title is not null, and indented if and only if indent is true.

Link copied to clipboard
fun <T : AbstractButton> Cell<T>.disableMnemonic(): Cell<T>

Removes the mnemonic from the AbstractButton.text of the AbstractButton in this Cell.

Link copied to clipboard
fun JIntSpinner.hasValue(lambda: (Int) -> Boolean): ComponentPredicate

Returns a ComponentPredicate that evaluates lambda on the value of this JIntSpinner.

Link copied to clipboard
fun <E> Cell<ComboBox<E>>.isEditable(editable: Boolean): Cell<ComboBox<E>>

Sets whether the editor of the ComboBox in this Cell, and returns this.

Link copied to clipboard
fun <T : AbstractButton> Cell<T>.loadMnemonic(): Cell<T>

Loads the mnemonic for the AbstractButton in this Cell based on its AbstractButton.text.

Link copied to clipboard
fun <T : JComponent> Cell<T>.onResetThis(callback: (Cell<T>) -> Unit): Cell<T>

Registers the callback to be invoked on the JComponent in this Cell when the dialog is reset, and returns this.

Link copied to clipboard
fun JComponent.setFixedHeight(height: Int)

Forces this JComponent to be height pixels high.

Link copied to clipboard
fun JComponent.setFixedWidth(width: Int)

Forces this JComponent to be width pixels wide.

Link copied to clipboard
fun LocalDateTime.toEpochMilli(): Long

Converts this LocalDateTime to an epoch millisecond timestamp.

Link copied to clipboard
fun Long.toLocalDateTime(): LocalDateTime

Converts an epoch millisecond timestamp to a LocalDateTime object.

Link copied to clipboard
fun <T : JTextField> Cell<T>.withDocument(document: Document): Cell<T>

Sets the document of the JTextField in this Cell and returns this.

Link copied to clipboard
fun <E> Cell<ComboBox<E>>.withFilter(filter: DocumentFilter): Cell<ComboBox<E>>

Sets the filter on the document of the ComboBox in this Cell, and returns this.

Link copied to clipboard
fun <T : JComponent> Cell<T>.withFixedHeight(height: Int): Cell<T>

Forces the JComponent in this Cell to be height pixels high, and returns this.

Link copied to clipboard
fun <T : JComponent> Cell<T>.withFixedWidth(width: Int): Cell<T>

Forces the JComponent in this Cell to be width pixels wide, and returns this.

Link copied to clipboard
fun <T : JComponent> Cell<T>.withName(name: String): Cell<T>

Sets the name of the JComponent in this Cell and returns this.

Link copied to clipboard
fun <E> Cell<ComboBox<E>>.withSimpleRenderer(toString: (E) -> String = { it.toString() }): Cell<ComboBox<E>>

Sets an item renderer on the ComboBox in this Cell that renders a label displaying the mapping of an item using toString, and returns this.